﻿@using MvcApplication.Entity
@model Category
@{
    Layout = null;
    ViewBag.Title = Model.Name + "-" + SiteInfoSession.SiteInfo.Name;
    PaginationResult<Post> data = ViewBag.Posts;
}
@Html.Partial("~/Views/Themes/Food/Header.cshtml")
<div class="rw-section rw-container right-sidebar">
    <div class="rw-inner clearfix">
        @Html.Partial("~/Views/Themes/Food/Sidebar.cshtml")

        <div class="rw-column rw-content">

            <div class="rw-row page-title ">
                <h1>@Model.Name</h1>
            </div>

            <div class="rw-row">

                <div class="blog-list">
                    @foreach (var post in data.Datas)
                    {

                        <div id="post-67" class="post clearfix post-67 type-post status-publish format-standard has-post-thumbnail hentry category-uncategorized tag-beautiful tag-begin tag-journey">
                            <div class="entry-photo">
                                @if (!string.IsNullOrEmpty(post.FirstPicture))
                                {
                                    <a href="/post_@post.ID">
                                        <img src="/image?path=@post.FirstPicture" alt="">
                                    </a>
                                }
                            </div>
                            <p>
                                <a href="/post_@post.ID">@post.Title</a>
                            </p>
                        </div> <!-- .entry -->
                        <div class="clear"></div>
                    }
                </div>
                <!-- .blog-list -->

                <div class="blog-pagination-links">
                    @if (data.PageIndex > 1)
                    {
                        <a href="/category_@Model.ID?pageIndex=@(data.PageIndex - 1)">
                            <i class="the-icon to-left fa fa-chevron-left"></i>上一页
                        </a>
                    }

                    @if (data.PageCount > data.PageIndex)
                    {
                        <a href="/category_@Model.ID?pageIndex=@(data.PageIndex + 1)">
                            <i class="the-icon to-left fa fa-chevron-left"></i>下一页
                        </a>
                    }
                </div>

            </div>
            <!-- .rw-row -->

        </div>

    </div>
    <!-- .rw-inner -->
</div>
@Html.Partial("~/Views/Themes/Food/Footer.cshtml")